//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
struct data {
	char a [10];//进程名
	int  basic;//basic表示优先数
	int time;//表示进程的运行时间
};
int main() {
	//操作系统第一题
	struct data p [3];
	double sum, t_time;
	sum = t_time = 0;
	for (int i = 0; i < 3; i++) {
		scanf("%s %d %d", p [i].a, &p [i].basic, &p [i].time);
	}
	for(int i=0;i<3;i++)
		for(int j=i+1;j<3;j++)
			if (p[i].basic<p[j].basic) {
				struct data t = p [j ];
				p [j ] = p [i];
				p [i] = t;
			}
	//冒泡排序已完成，优先级已经按basic降序成功
	for (int i = 0; i<3; i++) {
		t_time += p [i].time;
		sum += t_time;
	}	
	printf("%0.1f", sum / 3);
	return 0;
}
